Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move ConstantTermNormalizer #150

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Heizmann
Copy link
Member

  • Move class ConstantTermNormalizer from SMTInterpol to Library-SMTLIB
  • Extract method
  • Add support for new representation of bitvector constants (ConstantTerm with BigInteger value)
  • Add documentation

This class is currently not used by SMTInterpol. However, this class is used by several projects of Ultimate, e.g., by the SMTSolverBridge. Ultimate's projects should not depend on SMTInterpol or the SMTSolverBridge. Hence Ultimate currently duplicates this class to make the code available to its projects.

* Move class ConstantTermNormalizer from SMTInterpol to Library-SMTLIB
* Extract method
* Add support for new representation of bitvector constants
  (ConstantTerm with BigInteger value)
* Add documentation

This class is currently not used by SMTInterpol. However, this class is
used by several projects of Ultimate, e.g., by the SMTSolverBridge.
Ultimate's projects should not depend on SMTInterpol or the SMTSolverBridge.
Hence Ultimate currently duplicates this class to make the code available
to its projects.
}
}

private static Term convertConstantTerm(final Term term, final ConstantTerm ct) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why two input parameters? You can also use ct.getSort().

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@jhoenicke
Copy link
Member

I have a few questions:

  1. should we have it also handle bitvector constants? The current situation is that bv constants can be expressed as #b1010, #xa, or (_ bv10 4). But we normalize them in SMTInterpol to the last form, which is ConstantTerm with BigInteger value.
  2. I wonder if the convertConstant should be public. I have the same function in SMTAffineTerm and its one of the few things that I still use this class for.
  3. there is parseConstant in SMTAffineTerm. It also handles some other kinds of constants, e.g. the official (/ (- (to_real 4)) (to_real 5)) syntax or (- 0.4). These are not ConstantTerm but ApplicationTerm. Do you think it makes sense to support these here?

@Heizmann
Copy link
Member Author

I will respond to your questions in a few days...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants